//
//  PublishRentDesCell.m
//  CenturyCity
//
//  Created by beisheng03 on 2017/12/26.
//  Copyright © 2017年 beisheng. All rights reserved.
//

#import "PublishRentDesCell.h"

@interface PublishRentDesCell ()
@property (weak, nonatomic) IBOutlet UILabel *placeholderLabel;
@property (weak, nonatomic) IBOutlet UITextView *textVeiw;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottomMargin;

@end

@implementation PublishRentDesCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.bottomMargin.constant = 0;
    
    self.contentView.backgroundColor = [UIColor whiteColor];
    
    self.textVeiw.font = MYFONT(15);
    
    self.placeholderLabel.font = MYFONT(15);
    
    self.placeholderLabel.textColor = placeholderColor;
    
    self.placeholderLabel.text = @"房源详细描述";
    
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(textChange) name:UITextViewTextDidChangeNotification object:self.textVeiw];

    // Initialization code
}



- (void)setModel:(HouseParameterModel *)model{
    _model = model;
    
    if (self.model.house_details.length > 0) {
        
        self.textVeiw.text = self.model.house_details;
        
        [self textChange];
    }
    
}


- (void)textChange{
    
    self.model.house_details = self.textVeiw.text;
    
    
    self.placeholderLabel.hidden = self.textVeiw.hasText;
    
}


- (void)setIndex:(NSIndexPath *)index{
    
    _index = index;
        
    self.placeholderLabel.hidden = self.textVeiw.hasText;

    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
